home *** CD-ROM | disk | FTP | other *** search
/ The Original Shareware 1.1 / The Original Shareware (WeMake CDs)(Volume 1.1)(CDs, Inc)(1993).iso / 6 / asm1_01.zip / ASSEMBLE.DOC < prev   
Text File  |  1985-11-18  |  33KB  |  793 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.                    
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.                                         TABLE OF CONTENTS
  23.  
  24.                          Description ..................2
  25.  
  26.                          Syntax .......................2              
  27.  
  28.                            Labels .....................3
  29.  
  30.                            Opcodes ....................3
  31.  
  32.                            Operands ...................4
  33.  
  34.                            Pseudo ops .................5
  35.  
  36.                         Error Messages ................6
  37.  
  38.                         Source code ...................6
  39.  
  40.                         Disclaimer ....................7
  41.  
  42.                         Revisions......................8
  43.  
  44.                         Op code table .................9
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.                                         1
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.                                   ASSEMBLE.COM 
  71.  
  72.  
  73.                                    DESCRIPTION
  74.               This is a two pass assembler written in Turbo Pascal. It 
  75.         was written because I was a new owner of an IBM PCjr with little 
  76.         software and was not aware of any public domain assemblers that 
  77.         had reasonable performance. Additionally I had recently purchased 
  78.         Turbo Pascal from Borland International and wanted a project to 
  79.         help me learn Pascal.
  80.  
  81.              This is a simple assembler for Intel 8088/8086 instruction 
  82.         set. It closely follows the syntax of the instruction set 
  83.         described in THE 8806 BOOK by Russel Rector and George Alexy. It 
  84.         is also patterned after CHASM.BAS version 1.9 written in basic by 
  85.         David Whitman of Whitman Software (there have been numerious 
  86.         changes to avoid copywrite violations). It is not a macro 
  87.         assembler and therefore recognizes only a few pseudo op codes. 
  88.         Listed later in this documentation is a complete list of op codes 
  89.         and pseudo ops recognized by ASSEMBLE.COM.
  90.  
  91.              The input requirements to ASSEMBLE.COM are ordinary DOS 
  92.         files which can be created with most text editors. The output 
  93.         will be a listing sent to the screen, printer or a disk file and 
  94.         a .COM file. This assembler was designed to create executable 
  95.         programs and assembly code for use in BASIC or Turbo Pascal 
  96.         programs. It will not generate code that can be linked to other 
  97.         other programs. See your BASIC or TURBO instruction manuals for 
  98.         including executable code in your programs. Since this assembler 
  99.         is intended for small projects you will probably find bypassing 
  100.         the Link and conversion from .EXE to .COM files is a convenience. 
  101.         If you intend to write large software projects, I recommend you 
  102.         get a macro assembler such as IBM's or CHASM version 4.0 (also 
  103.         written in Turbo Pascal). Although intended for small projects, 
  104.         since both the input file and output file(s) are on the disc the 
  105.         only limitations to the size of your program is the disk space, 
  106.         number of labels you use and your endurance. Labels and their 
  107.         memory address are stored on the first pass in a data array. This 
  108.         array is limited to 400 lables. My goal is to keep this program 
  109.         under 35K bytes so it can be run on small systems. If you have 
  110.         the memory this program can easily be recompiled with a larger 
  111.         array defined. See the notice at the end for the source code.
  112.  
  113.                                      SYNTAX
  114.              Each line of source code begins with a label or blank space 
  115.         followed by the op code (8088 instruction or pseudo op) and then 
  116.         the operand(s) (if required by the opcode). The source code may be 
  117.         followed with a semicolon (;) and any comments for that line. 
  118.         Optionally a line may be only comments if it starts with a semi 
  119.         colon. A blank space must precede and follow the op code field. 
  120.         For readability I recommend one or more spaces between the label 
  121.         and the op code and between the op code and the operand. A comma 
  122.         must be used to separate operands. The requirement for a comma 
  123.         between operands differs from CHASM and should be noted when 
  124.         converting programs.
  125.  
  126.  
  127.                                         2
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.                                     Example
  137.         1stLabel mov  ax,90H    ;format example
  138.  
  139.                                      LABLES
  140.              Although labels may be longer only the first 12 letters of 
  141.         the label are stored for future reference therefore any labels 
  142.         with the first twelve characters the same will cause a duplicate 
  143.         label error. Also since the line parseing routine converts all 
  144.         source code not in single quotes to upper case prior to decodeing 
  145.         the line, you can not use upper and lower case to distinguish 
  146.         labels. For example LongLabelxxx1 and longlabelxxx2 are both 
  147.         stored as LONGLABLEXXX therefore would cause an duplicate label error. 
  148.         If you are going to use numbers to distinguish labels I suggest 
  149.         you use them at the beginning of a label such as 2LongLabelXXX.
  150.  
  151.                                     OP CODES
  152.              All of the op codes specified in THE 8086 BOOK are supported 
  153.         however in order to resolve some ambiguous op codes the syntax 
  154.         was modified. The first ambiguous opcode is JMP which can be 
  155.         either a 8 or 16 bit displacement jump. Eight bit displacement 
  156.         jumps are resolved by specifying JMPS for short jump. Jumps 
  157.         useing mem/reg (indirect) addressing for their destination must 
  158.         specify Near or Far to indicate a jump within the current CS or 
  159.         an intersegment jump. These jumps are coded as JMPN or JMPF. This 
  160.         same logic is used for CALLN and CALLF when using the mem/reg 
  161.         addressing mode. The other major area of ambiguity comes from 
  162.         using op codes that do not specify a register as either the 
  163.         destination or source. This assembler requires you to append the 
  164.         op code with a B or W to distinguish between bytes and words ie. 
  165.         MOVSB for move a string of bytes or MOVW [bx],8 to load 8 into 
  166.         the word address pointed to by BX.
  167.  
  168.              Normaly all data moves are assumed to be relative to the DS 
  169.         (data segment) register. This default can be over ridden one 
  170.         instruction at a time by using the SEG op code in the line prior 
  171.         to the desired over ride.
  172.                                      Example
  173.                    SEG   ES
  174.                    MOV   AX,[BX]
  175.         This moves a word into the accumulator from the address in the 
  176.         extra segment offset by the bx register. This is a little used 
  177.         function since ASSEMBLE assumes all of the segment registers are 
  178.         set to the same location as is required for the start of a .COM 
  179.         program. Access of system resources should be done with BIO or 
  180.         DOS calls when possible rather than going directly to a hardware 
  181.         memory location outside your program. 
  182.  
  183.              The opcode table lists the available opcodes and pseudo ops 
  184.         and the various addressing modes associated with each. Please 
  185.         note that the mem/reg addressing mode includes several sub modes 
  186.         such as base relative (using BX as an offset), stack relative 
  187.         (using BP as an offset), and indexed (useing the SI or DI). See 
  188.         the 8086 BOOK for an explanation of each mode.
  189.  
  190.  
  191.  
  192.  
  193.                                         3
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.                                     OPERANDS 
  203.              The operands describe to the assembler the destination and 
  204.         source of the data to be operated on. The 8088 uses a number of 
  205.         addressing modes to determine where that data is and should go. 
  206.         You will discover by looking at the op code table, not all modes 
  207.         can be used with an individual op code. Addressing modes are :
  208.  
  209.           Accumulator - data is transferred to/from the accumulator.
  210.           Displacement - the displacement value is added to the present IP.
  211.           Immediate - data is assembled into the instruction.
  212.           Memory/Reg - data is transferred to/from address pointed to
  213.                        by [mem] or [reg].
  214.           Register - data is transferred to/from the register.
  215.  
  216.         Lables can be used in the Immediate, Displacement and Memory 
  217.         addressing modes. This assembler follows the Intel convention of 
  218.         treating a lable operand as a refference to the value in a 
  219.         memory location unless it was defined by an EQU. If a value is 
  220.         added to that lable it is then treated as a refference to the 
  221.         location address. To use an offset to the lable to obtain a value 
  222.         in a memory location the lable and offset must be contained in 
  223.         brackets just as a numeric value would.
  224.            Operand        Meaning
  225.            Lable         refference value in the memory location 
  226.            Offset Lable  refference the memory location
  227.            Lable+5       refference the memory location at lable+5
  228.                           This is the same as Offset Lable+5.
  229.            $-Lable       refference to a memory location or a numeric
  230.                           value i.e. when defineing a buffer length.
  231.            [Lable+5]     refference the value in memory location lable+5
  232.            [1234]        refference the value in memory location 1234
  233.  
  234.         Addition, subtraction, multiplication and division are supported 
  235.         by the parser. Lables are treated as numbers when used in a math 
  236.         expression.
  237.  
  238.         Accumulator: The accumulator(s) are AX or AL and AH where AX is a 
  239.         16 bit accumulator, AL is the lower 8 bits of AX and AH is the 
  240.         higher 8 bits.
  241.  
  242.                                   DISPLACEMENT 
  243.              A displacement value to be added to the instruction pointer 
  244.         (IP) is included as immediate data in the opcode. The assembler 
  245.         calculates the amount of displacement based on the location of 
  246.         the opcode and then location of the address in the operand. The 
  247.         address in the operand can be expressed as a number (binary,hex 
  248.         or decimal) but is most commonly expressed as a label. 
  249.                                     Example
  250.         LABEL MOV AX,[BX]
  251.               CMP AX,10H
  252.               JLE LABEL
  253.  
  254.         With this example the assembler calculates a negative 
  255.         displacement to jump back to LABEL when then value in AX is less 
  256.         than or equal 10H.
  257.  
  258.  
  259.                                         4
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.                                    IMMEDIATE
  269.         All immediate data is assembled into the instruction 
  270.         code. This data can be represented in two ways. First immediate 
  271.         data can be presented in binary, decimal or hexidecimal format in 
  272.         a signed range of -32768 to 32767 (8000H to 7FFFH) or if the sign 
  273.         bit is not used, 0 to 65535 (0000H to FFFFH). As in these 
  274.         examples a 'H' is appended to the number to indicate hexidecimal. 
  275.         Binary numbers are expressed as a series of up to 16 ones and 
  276.         zeros followed by a B, i.e. 11010B represents 26. The other method 
  277.         of representing immediate data is with labels. The value of the 
  278.         label is the address at which the label was used or the value 
  279.         assigned to the label in an EQU pseudo op.  
  280.                                     Example
  281.         Lable equ 10
  282.         Here db  10
  283.              MOV BX,LABEL         ;Load BX with the value of Label 
  284.              MOV BX,OFFSET(Here)  ;Load BX with the address of Here
  285.  
  286.                                 MEMORY/REGISTER
  287.              This addressing mode is also called indirect addressing. The 
  288.         operand is used to point to a memory location that contains the 
  289.         data rather than the instruction containing the data as in the 
  290.         immediate addressing mode. The operand can be a memory location 
  291.         expressed as a label, decimal number or a hexidecimal number or 
  292.         it can be a memory location pointed to by a register. The 
  293.         following indirect modes are allowed:
  294.               MOV Reg,[BP]   
  295.               MOV [BX],Reg
  296.               MOV [BX+SI],Reg  ;BX plus SI displacement equal location
  297.               MOV Reg,[BX+DI]  ;BX plus DI       "        "      "
  298.               MOV Reg,[BP+SI]  ;BP plus SI       "        "      "
  299.               MOV [BP+DI],Reg  ;BP plus SI       "        "      "
  300.               MOV [DI],Reg
  301.               MOV Reg,[SI]
  302.               MOV LABEL,Reg  
  303.               MOV [1234],Reg
  304.         Any of the general purpose registers can be used in place of Reg 
  305.         in these examples. Immediate data may also be substituted for a 
  306.         source register however then the opcode most be appended with W 
  307.         or B so the assembler knows if you are pointing to a word or byte 
  308.         address. In addition to the above when an indirect address using 
  309.         a register is chosen a displacement may also be used. 
  310.                                      Example 
  311.               MOV Reg,10H[BP]     ;Source address equal BP+10H
  312.               MOV Reg,-5[BP+SI]   ;Source address equal BP+SI-5
  313.         DEMO  EQU FFH
  314.               MOV DEMO[BX+DI],Reg ;Destination address equal BX+DI+255
  315.  
  316.                                     REGISTER  
  317.              In this addressing mode the data is contained in or is to be 
  318.         stored in one of the 8088 registers. The  registers are AX 
  319.         (AL+AH), BX (BL+BH), CX (CL+CH), DX (DL+DH), BP, DI, SI  and the 
  320.         four segment registers CS, DS, ES, SS. All math operations use 
  321.         the accumulator (AX, AL or AH) plus the MUL and DIV use the DX 
  322.         register when 32 bit numbers are involved. The BX and BP 
  323.  
  324.  
  325.                                         5
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.         registers can be used as base pointers in the Data or Stack 
  335.         segments respectively. The CX register can be used for a 
  336.         automatic counter for some instructions. As demonstrated in 
  337.         earlier examples the SI and DI registers can be used as indexing 
  338.         registers. Any of the numerous assembly language books for the 
  339.         IBM PC or PCjr will give you an explanation of each of the 
  340.         processor registers and their uses.
  341.  
  342.                                  PSEUDO OPCODES
  343.              Pseudo opcodes are assembler directives that control the 
  344.         generation of the object code. The available pseudo ops are DB, 
  345.         DS, DW, ENDP, EQU, ORG and PROC.
  346.           DB = define byte and has operands of one or more bytes and/or 
  347.                a string ( DB 20H,'Demo' ). Strings are set off by single 
  348.                quotes. Numbers are less than 256 and expressed in binary, 
  349.                decimal or hexidecimal.
  350.           DS = define segment and initializes a string of memory 
  351.                locations. The first operand defines the number of bytes to 
  352.                be initialized. If included the second operand defines the 
  353.                value the memory is to be initialized to. The default value 
  354.                is zero. ( DS 20,FFH ;initialize 20 bytes to 255).
  355.           DW = define word and its operand(s) must be a number or a 
  356.                label. With DW the low order byte is stored first in memory 
  357.                as this is the format used by the 8088 for integer storage
  358.                (i.e. dw 1020H = db 20H,10H).
  359.           EQU= define the value of a label. All label definitions must 
  360.                occur at the beginning of your program or errors may occur 
  361.                in the assembly process. The most common error message 
  362.                received from defining a label late in the program is 'PHASE 
  363.                ERROR'. A phase error indicates the assembler generated a 
  364.                address for a label on the second pass different from that 
  365.                of the  first pass.
  366.           ORG= reset the location counter to new origin. Since all .COM 
  367.                programs start at 100H the default setting for ASSEMBLE.COM 
  368.                is 100H however you may have a need to start at 00H for a 
  369.                driver routine or a machine language routine for BASIC. 
  370.           PROC and ENDP are used together to define a program or procedure 
  371.                as Near or Far. This information is used to determine the 
  372.                type of return to be generated when a RET is encountered. 
  373.                If no procedure is defined a Near procedure is assumed. The 
  374.                syntax is:
  375.                PROC NEAR ;Proc must be followed by Near or Far
  376.                ....
  377.                ....
  378.                ENDP
  379.                If PROC is used an ENDP must be used.
  380.  
  381.  
  382.                                  ERROR MESSAGES
  383.              All error messages and diagnostics are printed immediately 
  384.         before the line in which the error occurs. The total number of 
  385.         error and diagnostic messages will be displayed at the end of the 
  386.         source code print out immediately prior to the symbol table dump.
  387.              I have made an attempt to make error messages as user 
  388.         friendly as possible. The most cryptic of the error messages is 
  389.  
  390.  
  391.                                         6
  392.  
  393.  
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.         the series you receive when there is a syntax error. This message 
  401.         will be the opcode and ASSEMBLE.COM's interpretation of the type 
  402.         of data included in the operands. For example the message
  403.         *** Syntax Error: MOV (16 bit immediate or 8 bit immediate), (none)
  404.         would appear immediate before a line of code containing the 
  405.         instruction MOV 45H. By reviewing the type of data and the 
  406.         allowable operands for each instruction you should be able to 
  407.         locate the error. In the instruction above both a destination and 
  408.         source operand are required and if immediate data is used it must 
  409.         be the source operand. 
  410.              'Phase Error' is most commonly caused by referencing an 
  411.         equate before defineing it. I strongly recommend you only use the 
  412.         EQU pseudo op at the beginning of your source code. This practice 
  413.         should prevent this error and will make your source code easier 
  414.         to read.
  415.              'Error: EQU without symbol' is received when you use the equate 
  416.         pseudo-op without a label.
  417.              'Error: EQU with forward reference' is received if you 
  418.         attempt to use a forward reference when equating a label.
  419.              'Error: ENDP without PROC'. You must specify where the 
  420.         procedure begins.
  421.              'Error: Missing ENDP'. You must specify where the procedure 
  422.         ends if PROC is used.
  423.              'Error: Procedures nested too deeply'. Only 10 levels of 
  424.         nesting are allowed.
  425.              'Error: Duplicate label'. See section on labels.
  426.              'Error: Data too long' indicates use of a byte operand where 
  427.         the data is out of the range of 0 to 255.
  428.              'Error: Too far for short jump' indicates a jump attempt
  429.         longer than -128 or +127 bytes.
  430.              'Error: Undefined Symbol' plus the operand  is displayed 
  431.         when no match is found in the symbol table. Frequently caused by 
  432.         bad syntax in the operand.
  433.              'Error: Illegal or undefined argument for OFFSET' is simular 
  434.         to 'Undefined Symbol' 
  435.              
  436.              Two diagnostic messages may be given. The first follows a 
  437.         syntax error and is 'Specify word or byte operand' if the 
  438.         assembler could not determine which to use. The opcode must be 
  439.         corrected by appending a B or W to it. The assembler is not smart 
  440.         enough to give you this very often. The other message is just a 
  441.         notice that you used a long jump where you could have used a 
  442.         short jump and saved a byte of object code.
  443.  
  444.                                    SOURCE CODE
  445.              Turbo Pascal source code for this assembler is avaliable for 
  446.         those who wish to customize it for their own needs (or those who 
  447.         would like to see what makes it tick). If you would like a copy 
  448.         of the source code send a formatted disk and $10 to
  449.                                  George Fulford
  450.                                  RR 1 Box 163c
  451.                                  Shellsburg Ia 52332
  452.         Although I have no intentions of entering the software market at 
  453.         this time I do plan to make corrections to this program as the 
  454.         bugs are found. If you obtain a copy of the source code from me 
  455.  
  456.  
  457.                                         7
  458.  
  459.  
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466.         it will be the most up to date version.
  467.  
  468.                                WARRENTY/GUARANTEE
  469.              There is NONE. 
  470.              This assembler runs on my PCjr and since I used all standard 
  471.         Turbo Pascal it should run on any PC DOS machine. If it does not 
  472.         I probably won't be able to help you. 
  473.  
  474.         I have spent quite a bit of time debuging but I am sure there are 
  475.         still a few bugs lurking in the code. I will attempt to stamp out 
  476.         any reported.
  477.  
  478.                                      UPDATES
  479.  
  480.                           Changes made by version 1.01
  481.         1) A more sophisticated number parsing routine was added. An 
  482.         offset may now be added to a lable. Multiplication and 
  483.         subtraction now occur in the correct order.
  484.         2) $ can now be used to indicate the present memory location.
  485.         3) Due to memory management problems with the PCjr lables are no 
  486.         longer stored in a linked list that uses all of the avaliable 
  487.         memory. Lables are stored in a predefined array of 400. This 
  488.         should be sufficient for all small programs. The 'Stack Overflow 
  489.         Error' is no longer applicable.
  490.         4) Lable storage has been expanded to twelve characters to 
  491.         improve the readability of lables.
  492.         5) A larger input buffer has been allocated to reduce disk access 
  493.         time and other minor changes in code to inprove performance.
  494.         6) Bugs in DIV, SHR, SHL, ORB instruction have been corrected. 
  495.         DIVB and DIVW have been added to allow 8 or 16 bit divides useing 
  496.         indirect addressing.
  497.         7) A bug in the line parsing routine that stopped the parsing at 
  498.         a semicolon that was enclosed in quotes has been corrected.
  499.         8) An error in interpeting [BP] has been corrected.
  500.  
  501.  
  502.  
  503.  
  504.  
  505.  
  506.  
  507.  
  508.  
  509.  
  510.  
  511.  
  512.  
  513.  
  514.  
  515.  
  516.  
  517.  
  518.  
  519.  
  520.  
  521.  
  522.  
  523.                                         8
  524.  
  525.  
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532.                                   OP CODE TABLE
  533.              addressing modes supported  (b/w = must specify byte or word)
  534.              A = acumulator reg(ax, ah, al)
  535.              b/w = must add B or W to opcode for this addressing mode
  536.              D = displacememt (8 or 16 bit as required by the instruction)
  537.              I = immediate (byte for 8 bit registers, word for 16 bit reg)
  538.              M/R = memory or register indirect addressing
  539.              N = none
  540.              R = register(bx, cx, dx, bp, si, di)
  541.              S = segment register (cs, ds, es, ss)
  542.          Op                   Operand 
  543.         types
  544.           dest.  N | A |  A  | R | R | M/R |  R  | M/R | I | I | D | M/R
  545.           source N | I | M/R | I | N |  R  | M/R |  I  | I | N | N |  N
  546.         AAA      x |   |     |   |   |     |     |     |   |   |   |
  547.         AAD      x |   |     |   |   |     |     |     |   |   |   |
  548.         AAM      x |   |     |   |   |     |     |     |   |   |   |
  549.         AAS      x |   |     |   |   |     |     |     |   |   |   |
  550.         ADC        | x |     | x |   |  x  |  x  | b/w |   |   |   |
  551.  
  552.         AND        | x |     | x |   |  x  |  x  | b/w |   |   |   |
  553.         CALL       |   |     |   |   |     |     |     | x |   | x |
  554.         CALLF      |   |     |   |   |     |     |     |   |   |   |  x
  555.         CALLN      |   |     |   |   |     |     |     |   |   |   |  x
  556.         CBW      x |   |     |   |   |     |     |     |   |   |   |
  557.  
  558.         CLC      x |   |     |   |   |     |     |     |   |   |   |
  559.         CLD      x |   |     |   |   |     |     |     |   |   |   |
  560.         CLI      x |   |     |   |   |     |     |     |   |   |   |
  561.         CMC      x |   |     |   |   |     |     |     |   |   |   |
  562.         CMP        | x |     | x |   |  x  |  x  | b/w |   |   |   |
  563.  
  564.         CMPS   b/w |   |     |   |   |     |     |     |   |   |   |
  565.         CWD      x |   |     |   |   |     |     |     |   |   |   |
  566.         DAA      x |   |     |   |   |     |     |     |   |   |   |
  567.         DAS      x |   |     |   |   |     |     |     |   |   |   |
  568.         DB         |   |     |   |   |     |     |     | x | x |   |
  569.  
  570.         DEC        |   |     |   | x |     |     |     |   |   |   | b/w
  571.         DIV        |   |     |   | x |     |     |     |   |   |   | b/w
  572.         DS         |   |     |   |   |     |     |     | x | x |   |
  573.         DW         |   |     |   |   |     |     |     | x | x |   | 
  574.         ENDP     x |   |     |   |   |     |     |     |   |   |   |
  575.  
  576.         EQU        |   |     |   |   |     |     |     |   | x |   | memory
  577.         HLT      x |   |     |   |   |     |     |     |   |   |   |
  578.         IDIV       |   |  x  |   |   |     |     |     |   |   |   |
  579.         IMUL       |   |  x  |   |   |     |     |     |   |   |   |
  580.         IN         | x |note1|   |   |     |     |     |   |   |   |
  581.  
  582.  
  583.  
  584.  
  585.  
  586.  
  587.  
  588.  
  589.                                         9
  590.  
  591.  
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598.          Op                   Operand 
  599.         types
  600.           dest.  N | A |  A  | R | R | M/R |  R  | M/R | I | I | D | M/R
  601.           source N | I | M/R | I | N |  R  | M/R |  I  | I | N | N |  N
  602.         INC        |   |     |   | x |     |     |     |   |   |   | b/w
  603.         INT      x |   |     |   |   |     |     |     |   | x |   |
  604.         INTO     x |   |     |   |   |     |     |     |   |   |   |
  605.         IRET     x |   |     |   |   |     |     |     |   |   |   |
  606.         JA         |   |     |   |   |     |     |     |   |   | x |
  607.  
  608.         JAE        |   |     |   |   |     |     |     |   |   | x |
  609.         JB         |   |     |   |   |     |     |     |   |   | x |
  610.         JBE        |   |     |   |   |     |     |     |   |   | x |
  611.         JCXZ       |   |     |   |   |     |     |     |   |   | x |
  612.         JE         |   |     |   |   |     |     |     |   |   | x |
  613.  
  614.         JG         |   |     |   |   |     |     |     |   |   | x |
  615.         JGE        |   |     |   |   |     |     |     |   |   | x |
  616.         JL         |   |     |   |   |     |     |     |   |   | x |
  617.         JLE        |   |     |   |   |     |     |     |   |   | x |
  618.         JMP        |   |     |   |   |     |     |     |   |   | x |
  619.  
  620.         JMPF       |   |     |   |   |     |     |     |   |   | x |
  621.         JMPN       |   |     |   |   |     |     |     |   |   | x |
  622.         JMPS       |   |     |   |   |     |     |     |   |   | x |
  623.         JNE        |   |     |   |   |     |     |     |   |   | x |
  624.         JNO        |   |     |   |   |     |     |     |   |   | x |
  625.  
  626.         JNP        |   |     |   |   |     |     |     |   |   | x |
  627.         JNS        |   |     |   |   |     |     |     |   |   | x |
  628.         JNZ        |   |     |   |   |     |     |     |   |   | x |
  629.         JO         |   |     |   |   |     |     |     |   |   | x |
  630.         JP         |   |     |   |   |     |     |     |   |   | x |
  631.  
  632.         JPE        |   |     |   |   |     |     |     |   |   | x |
  633.         JPO        |   |     |   |   |     |     |     |   |   | x |
  634.         JS         |   |     |   |   |     |     |     |   |   | x |
  635.         JZ         |   |     |   |   |     |     |     |   |   | x |
  636.         LAHF     x |   |     |   |   |     |     |     |   |   |   |
  637.  
  638.         LDS        |   |     |   |   |     |note2|     |   |   |   |
  639.         LEA        |   |     |   |   |     |note2|     |   |   |   |
  640.         LES        |   |     |   |   |     |note2|     |   |   |   |
  641.         LOCK     x |   |     |   |   |     |     |     |   |   |   |
  642.         LODS   b/w |   |     |   |   |     |     |     |   |   |   |
  643.  
  644.         LOOP       |   |     |   |   |     |     |     |   |   | x |
  645.         LOOPE      |   |     |   |   |     |     |     |   |   | x |
  646.         LOOPNE     |   |     |   |   |     |     |     |   |   | x |
  647.         LOOPNZ     |   |     |   |   |     |     |     |   |   | x |
  648.         LOOPZ      |   |     |   |   |     |     |     |   |   | x |
  649.  
  650.  
  651.  
  652.  
  653.  
  654.  
  655.                                        10
  656.  
  657.  
  658.  
  659.  
  660.  
  661.  
  662.  
  663.  
  664.          Op                   Operand 
  665.         types
  666.           dest.  N | A |  A  | R | R | M/R |  R  | M/R | I | I | D | M/R
  667.           source N | I | M/R | I | N |  R  | M/R |  I  | I | N | N |  N
  668.         MOV   note3|   |  x  |   |   |  x  |  x  | b/w |   |   |   |
  669.         MOVS   b/w |   |     |   |   |     |     |     |   |   |   |
  670.         MUL        |   |  x  |   |   |     |     |     |   |   |   |
  671.         NEG        |   |     |   | x |     |     |     |   |   |   |
  672.         NOP      x |   |     |   |   |     |     |     |   |   |   |
  673.  
  674.         NOT        |   |     |   | x |     |     |     |   |   |   | b/w
  675.         OR         | x |     | x |   |  x  |  x  | b/w |   |   |   |
  676.         ORG        |   |     |   |   |     |     |     |   | x |   |
  677.         OUT        |   |note1|   |   |     |     |     |   |   |   |
  678.         POP        |   |     |   | x |     |     |     |   |   |   |x or seg
  679.  
  680.         POPF     x |   |     |   |   |     |     |     |   |   |   |
  681.         PROC  note4|   |     |   |   |     |     |     |   |   |   |
  682.         PUSH       |   |     |   | x |     |     |     |   |   |   |x or seg
  683.         PUSHF    x |   |     |   |   |     |     |     |   |   |   |
  684.         RCL        |   |     |   | x |     |     |     |   |   |   | b/w
  685.  
  686.         RCR        |   |     |   | x |     |     |     |   |   |   | b/w
  687.         REP      x |   |     |   |   |     |     |     |   |   |   |
  688.         REPE     x |   |     |   |   |     |     |     |   |   |   |
  689.         REPNE    x |   |     |   |   |     |     |     |   |   |   |
  690.         REPNZ    x |   |     |   |   |     |     |     |   |   |   |
  691.  
  692.         REPZ     x |   |     |   |   |     |     |     |   |   |   |
  693.         RET      x |   |     |   |   |     |     |     |   |   | x |
  694.         ROL        |   |     |   | x |     |     |     |   |   |   | b/w
  695.         ROR        |   |     |   | x |     |     |     |   |   |   | b/w
  696.         SAHF     x |   |     |   |   |     |     |     |   |   |   |
  697.  
  698.         SAR        |   |     |   | x |     |     |     |   |   |   | b/w
  699.         SBB        | x |     | x |   |  x  |  x  | b/w |   |   |   |
  700.         SCAS   b/w |   |     |   |   |     |     |     |   |   |   |
  701.         SEG        |   |     |   |   |     |     |     |   | x |   |
  702.         SHL        |   |     |   | x |     |     | b/w |   |   |   |
  703.  
  704.         SHR        |   |     |   | x |     |     | b/w |   |   |   |
  705.         STC      x |   |     |   |   |     |     |     |   |   |   |
  706.         STD      x |   |     |   |   |     |     |     |   |   |   |
  707.         STI      x |   |     |   |   |     |     |     |   |   |   |
  708.         STOS   b/w |   |     |   |   |     |     |     |   |   |   |
  709.  
  710.         SUB        | x |     | x |   |  x  |  x  | b/w |   |   |   |
  711.         TEST       | x |     | x |   |  x  |  x  | b/w |   |   |   |
  712.         WAIT     x |   |     |   |   |     |     |     |   |   |   |
  713.         XCHG       |   |note5|   |   |  x  |  x  |     |   |   |   |
  714.         XLAT     x |   |     |   |   |     |     |     |   |   |   |
  715.  
  716.         XOR        | x |     | x |   |  x  |  x  | b/w |   |   |   |
  717.  
  718.  
  719.  
  720.  
  721.                                        11
  722.  
  723.  
  724.  
  725.  
  726.  
  727.  
  728.  
  729.  
  730.         note 1 IN/OUT supports  DX<-acum(8 or 16) and  port<-acum(8 or 16).
  731.         note 2 These instructions can use only memory reference
  732.                in the source operand.
  733.         note 3 MOV also supports mem<-acum  seg<-M/R  and  M/R<-seg(or CS).
  734.         note 4 Must specify near or far PROCedure.
  735.         note 5 The accumulator can be exchanged with any of the registers
  736.                using the form XCHG AX,BX or XCHG BX
  737.  
  738.  
  739.  
  740.  
  741.  
  742.  
  743.  
  744.  
  745.  
  746.  
  747.  
  748.  
  749.  
  750.  
  751.  
  752.  
  753.  
  754.  
  755.  
  756.  
  757.  
  758.  
  759.  
  760.  
  761.  
  762.  
  763.  
  764.  
  765.  
  766.  
  767.  
  768.  
  769.  
  770.  
  771.  
  772.  
  773.  
  774.  
  775.  
  776.  
  777.  
  778.  
  779.  
  780.  
  781.  
  782.  
  783.  
  784.  
  785.  
  786.  
  787.                                        12
  788.  
  789.  
  790.  
  791.  
  792.